package com.ssy.lingxi.order.model.constant;

import com.ssy.lingxi.common.language.LanguageHolder;
import com.ssy.lingxi.order.model.vo.basic.response.DropdownItem;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 送货相关外部状态枚举
 * @author czh
 * @version 2.0.0
 * @date 2021-07-16
 */
public enum DeliveryOuterStatusEnum {

    WAIT_CONFIRM(1, "待确认"),

    ALREADY_CONFIRM(2, "已确认"),

    UNKNOWN(3, "未知");

    DeliveryOuterStatusEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    /**
     * 外部状态枚举值
     */
    private Integer code;

    /**
     * 外部状态枚举值
     */
    private String name;

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    /**
     * 根据外部状态枚举值获得外部状态名称
     * @param code 外部状态枚举值
     * @return 外部状态名称
     */
    public static String getNameByCode(Integer code) {
        switch (code){
            case 1:
                return WAIT_CONFIRM.name;
            case 2 :
                return ALREADY_CONFIRM.name;
            default:
                return UNKNOWN.name;
        }
    }
}
